home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Terminals.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  11.6 KB  |  506 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Terminals.a
  3. ;
  4. ;    Contains:    Communications Toolbox Terminal tool Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  21. __TERMINALS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  25.     include 'Dialogs.a'
  26.     ENDIF
  27. ;        include 'Errors.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'Memory.a'                                            ;
  30. ;            include 'Types.a'                                        ;
  31. ;            include 'MixedMode.a'                                    ;
  32. ;        include 'Windows.a'                                        ;
  33. ;            include 'Quickdraw.a'                                    ;
  34. ;                include 'QuickdrawText.a'                            ;
  35. ;            include 'Events.a'                                        ;
  36. ;                include 'OSUtils.a'                                ;
  37. ;            include 'Controls.a'                                    ;
  38. ;                include 'Menus.a'                                    ;
  39. ;        include 'TextEdit.a'                                        ;
  40.  
  41.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  42.     include 'CTBUtilities.a'
  43.     ENDIF
  44. ;        include 'StandardFile.a'                                    ;
  45. ;            include 'Files.a'                                        ;
  46. ;        include 'AppleTalk.a'                                        ;
  47.  
  48.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  49.     include 'Connections.a'
  50.     ENDIF
  51.  
  52. ; current Terminal Manager version     
  53. curTMVersion                    EQU        2
  54. ; current Terminal Manager Environment Record version     
  55. curTermEnvRecVers                EQU        0
  56. ; error codes    
  57. tmGenericError                    EQU        -1
  58. tmNoErr                            EQU        0
  59. tmNotSent                        EQU        1
  60. tmEnvironsChanged                EQU        2
  61. tmNotSupported                    EQU        7
  62. tmNoTools                        EQU        8
  63.  
  64. ; typedef OSErr             TMErr
  65.  
  66. tmInvisible                        EQU        1 << 0
  67. tmSaveBeforeClear                EQU        1 << 1
  68. tmNoMenus                        EQU        1 << 2
  69. tmAutoScroll                    EQU        1 << 3
  70. tmConfigChanged                    EQU        1 << 4
  71.  
  72. ; typedef unsigned long     TMFlags
  73.  
  74. selTextNormal                    EQU        1 << 0
  75. selTextBoxed                    EQU        1 << 1
  76. selGraphicsMarquee                EQU        1 << 2
  77. selGraphicsLasso                EQU        1 << 3
  78. tmSearchNoDiacrit                EQU        1 << 8
  79. tmSearchNoCase                    EQU        1 << 9
  80.  
  81. ; typedef unsigned short     TMSearchTypes
  82. ; typedef short             TMSelTypes
  83.  
  84. cursorText                        EQU        1
  85. cursorGraphics                    EQU        2
  86.  
  87. ; typedef unsigned short     TMCursorTypes
  88.  
  89. tmTextTerminal                    EQU        1 << 0
  90. tmGraphicsTerminal                EQU        1 << 1
  91.  
  92. ; typedef unsigned short     TMTermTypes
  93. TermDataBlock             RECORD    0
  94. flags                     ds.w   1        ; offset: $0 (0)
  95. theData                     ds.l   1        ; offset: $2 (2)
  96. auxData                     ds.l   1        ; offset: $6 (6)
  97. reserved                 ds.l   1        ; offset: $A (10)
  98. sizeof                     EQU *            ; size:   $E (14)
  99.                         ENDR
  100.  
  101. ; typedef struct TermDataBlock  TermDataBlock
  102. ; typedef TermDataBlock     *TermDataBlockPtr, **TermDataBlockH, **TermDataBlockHandle
  103. TermEnvironRec             RECORD    0
  104. version                     ds.w   1        ; offset: $0 (0)
  105. termType                 ds.w   1        ; offset: $2 (2)
  106. textRows                 ds.w   1        ; offset: $4 (4)
  107. textCols                 ds.w   1        ; offset: $6 (6)
  108. cellSize                 ds     Point    ; offset: $8 (8)
  109. graphicSize                 ds     Rect    ; offset: $C (12)
  110. slop                     ds     Point    ; offset: $14 (20)
  111. auxSpace                 ds     Rect    ; offset: $18 (24)
  112. sizeof                     EQU *            ; size:   $20 (32)
  113.                         ENDR
  114.  
  115. ; typedef struct TermEnvironRec  TermEnvironRec
  116. ; typedef TermEnvironRec     *TermEnvironPtr
  117. TMSelection             RECORD    0
  118. selRect                     ds     Rect    ; offset: $0 (0)
  119.                          ORG 0
  120. selRgnHandle             ds.l   1        ; offset: $0 (0)
  121.                          ORG 8
  122. sizeof                     EQU *            ; size:   $8 (8)
  123.                         ENDR
  124.  
  125. ; typedef union TMSelection  TMSelection
  126. ; typedef struct TermRecord  TermRecord, *TermPtr, **TermHandle
  127. TermRecord                 RECORD    0
  128. procID                     ds.w   1        ; offset: $0 (0)
  129. flags                     ds.l   1        ; offset: $2 (2)
  130. errCode                     ds.w   1        ; offset: $6 (6)
  131. refCon                     ds.l   1        ; offset: $8 (8)
  132. userData                 ds.l   1        ; offset: $C (12)
  133. defProc                     ds.l   1        ; offset: $10 (16)
  134. config                     ds.l   1        ; offset: $14 (20)
  135. oldConfig                 ds.l   1        ; offset: $18 (24)
  136. environsProc             ds.l   1        ; offset: $1C (28)
  137. reserved1                 ds.l   1        ; offset: $20 (32)
  138. reserved2                 ds.l   1        ; offset: $24 (36)
  139. tmPrivate                 ds.l   1        ; offset: $28 (40)
  140. sendProc                 ds.l   1        ; offset: $2C (44)
  141. breakProc                 ds.l   1        ; offset: $30 (48)
  142. cacheProc                 ds.l   1        ; offset: $34 (52)
  143. clikLoop                 ds.l   1        ; offset: $38 (56)
  144. owner                     ds.l   1        ; offset: $3C (60)
  145. termRect                 ds     Rect    ; offset: $40 (64)
  146. viewRect                 ds     Rect    ; offset: $48 (72)
  147. visRect                     ds     Rect    ; offset: $50 (80)
  148. lastIdle                 ds.l   1        ; offset: $58 (88)
  149. selection                 ds.l   2        ; offset: $5C (92)
  150. selType                     ds.w   1        ; offset: $64 (100)
  151. mluField                 ds.l   1        ; offset: $66 (102)
  152. sizeof                     EQU *            ; size:   $6A (106)
  153.                         ENDR
  154.  
  155. ;
  156. ; pascal TMErr InitTM(void)
  157. ;
  158.     IF GENERATINGCFM THEN
  159.         IMPORT_CFM_FUNCTION    InitTM
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal Handle TMGetVersion(TermHandle hTerm)
  164. ;
  165.     IF GENERATINGCFM THEN
  166.         IMPORT_CFM_FUNCTION    TMGetVersion
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal short TMGetTMVersion(void)
  171. ;
  172.     IF GENERATINGCFM THEN
  173.         IMPORT_CFM_FUNCTION    TMGetTMVersion
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal TermHandle TMNew(const Rect *termRect, const Rect *viewRect, TMFlags flags, short procID, WindowPtr owner, TerminalSendUPP sendProc, TerminalCacheUPP cacheProc, TerminalBreakUPP breakProc, TerminalClikLoopUPP clikLoop, TerminalEnvironsUPP environsProc, long refCon, long userData)
  178. ;
  179.     IF GENERATINGCFM THEN
  180.         IMPORT_CFM_FUNCTION    TMNew
  181.     ENDIF
  182.  
  183. ;
  184. ; pascal void TMDispose(TermHandle hTerm)
  185. ;
  186.     IF GENERATINGCFM THEN
  187.         IMPORT_CFM_FUNCTION    TMDispose
  188.     ENDIF
  189.  
  190. ;
  191. ; pascal void TMKey(TermHandle hTerm, const EventRecord *theEvent)
  192. ;
  193.     IF GENERATINGCFM THEN
  194.         IMPORT_CFM_FUNCTION    TMKey
  195.     ENDIF
  196.  
  197. ;
  198. ; pascal void TMUpdate(TermHandle hTerm, RgnHandle visRgn)
  199. ;
  200.     IF GENERATINGCFM THEN
  201.         IMPORT_CFM_FUNCTION    TMUpdate
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal void TMPaint(TermHandle hTerm, const TermDataBlock *theTermData, const Rect *theRect)
  206. ;
  207.     IF GENERATINGCFM THEN
  208.         IMPORT_CFM_FUNCTION    TMPaint
  209.     ENDIF
  210.  
  211. ;
  212. ; pascal void TMActivate(TermHandle hTerm, Boolean activate)
  213. ;
  214.     IF GENERATINGCFM THEN
  215.         IMPORT_CFM_FUNCTION    TMActivate
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal void TMResume(TermHandle hTerm, Boolean resume)
  220. ;
  221.     IF GENERATINGCFM THEN
  222.         IMPORT_CFM_FUNCTION    TMResume
  223.     ENDIF
  224.  
  225. ;
  226. ; pascal void TMClick(TermHandle hTerm, const EventRecord *theEvent)
  227. ;
  228.     IF GENERATINGCFM THEN
  229.         IMPORT_CFM_FUNCTION    TMClick
  230.     ENDIF
  231.  
  232. ;
  233. ; pascal void TMIdle(TermHandle hTerm)
  234. ;
  235.     IF GENERATINGCFM THEN
  236.         IMPORT_CFM_FUNCTION    TMIdle
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal long TMStream(TermHandle hTerm, void *theBuffer, long theLength, CMFlags flags)
  241. ;
  242.     IF GENERATINGCFM THEN
  243.         IMPORT_CFM_FUNCTION    TMStream
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal Boolean TMMenu(TermHandle hTerm, short menuID, short item)
  248. ;
  249.     IF GENERATINGCFM THEN
  250.         IMPORT_CFM_FUNCTION    TMMenu
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal void TMReset(TermHandle hTerm)
  255. ;
  256.     IF GENERATINGCFM THEN
  257.         IMPORT_CFM_FUNCTION    TMReset
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal void TMClear(TermHandle hTerm)
  262. ;
  263.     IF GENERATINGCFM THEN
  264.         IMPORT_CFM_FUNCTION    TMClear
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal void TMResize(TermHandle hTerm, const Rect *newViewRect)
  269. ;
  270.     IF GENERATINGCFM THEN
  271.         IMPORT_CFM_FUNCTION    TMResize
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal long TMGetSelect(TermHandle hTerm, Handle theData, ResType *theType)
  276. ;
  277.     IF GENERATINGCFM THEN
  278.         IMPORT_CFM_FUNCTION    TMGetSelect
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal void TMGetLine(TermHandle hTerm, short lineNo, TermDataBlock *theTermData)
  283. ;
  284.     IF GENERATINGCFM THEN
  285.         IMPORT_CFM_FUNCTION    TMGetLine
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal void TMSetSelection(TermHandle hTerm, const TMSelection *theSelection, TMSelTypes selType)
  290. ;
  291.     IF GENERATINGCFM THEN
  292.         IMPORT_CFM_FUNCTION    TMSetSelection
  293.     ENDIF
  294.  
  295. ;
  296. ; pascal void TMScroll(TermHandle hTerm, short dh, short dv)
  297. ;
  298.     IF GENERATINGCFM THEN
  299.         IMPORT_CFM_FUNCTION    TMScroll
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal Boolean TMValidate(TermHandle hTerm)
  304. ;
  305.     IF GENERATINGCFM THEN
  306.         IMPORT_CFM_FUNCTION    TMValidate
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal void TMDefault(Ptr *theConfig, short procID, Boolean allocate)
  311. ;
  312.     IF GENERATINGCFM THEN
  313.         IMPORT_CFM_FUNCTION    TMDefault
  314.     ENDIF
  315.  
  316. ;
  317. ; pascal Handle TMSetupPreflight(short procID, long *magicCookie)
  318. ;
  319.     IF GENERATINGCFM THEN
  320.         IMPORT_CFM_FUNCTION    TMSetupPreflight
  321.     ENDIF
  322.  
  323. ;
  324. ; pascal void TMSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  325. ;
  326.     IF GENERATINGCFM THEN
  327.         IMPORT_CFM_FUNCTION    TMSetupSetup
  328.     ENDIF
  329.  
  330. ;
  331. ; pascal Boolean TMSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  332. ;
  333.     IF GENERATINGCFM THEN
  334.         IMPORT_CFM_FUNCTION    TMSetupFilter
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal void TMSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  339. ;
  340.     IF GENERATINGCFM THEN
  341.         IMPORT_CFM_FUNCTION    TMSetupItem
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal void TMSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  346. ;
  347.     IF GENERATINGCFM THEN
  348.         IMPORT_CFM_FUNCTION    TMSetupXCleanup
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal void TMSetupPostflight(short procID)
  353. ;
  354.     IF GENERATINGCFM THEN
  355.         IMPORT_CFM_FUNCTION    TMSetupPostflight
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal Ptr TMGetConfig(TermHandle hTerm)
  360. ;
  361.     IF GENERATINGCFM THEN
  362.         IMPORT_CFM_FUNCTION    TMGetConfig
  363.     ENDIF
  364.  
  365. ;
  366. ; pascal short TMSetConfig(TermHandle hTerm, const void *thePtr)
  367. ;
  368.     IF GENERATINGCFM THEN
  369.         IMPORT_CFM_FUNCTION    TMSetConfig
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr TMIntlToEnglish(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  374. ;
  375.     IF GENERATINGCFM THEN
  376.         IMPORT_CFM_FUNCTION    TMIntlToEnglish
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal OSErr TMEnglishToIntl(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  381. ;
  382.     IF GENERATINGCFM THEN
  383.         IMPORT_CFM_FUNCTION    TMEnglishToIntl
  384.     ENDIF
  385.  
  386. ;
  387. ; pascal void TMGetToolName(short id, Str255 name)
  388. ;
  389.     IF GENERATINGCFM THEN
  390.         IMPORT_CFM_FUNCTION    TMGetToolName
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal short TMGetProcID(ConstStr255Param name)
  395. ;
  396.     IF GENERATINGCFM THEN
  397.         IMPORT_CFM_FUNCTION    TMGetProcID
  398.     ENDIF
  399.  
  400. ;
  401. ; pascal void TMSetRefCon(TermHandle hTerm, long refCon)
  402. ;
  403.     IF GENERATINGCFM THEN
  404.         IMPORT_CFM_FUNCTION    TMSetRefCon
  405.     ENDIF
  406.  
  407. ;
  408. ; pascal long TMGetRefCon(TermHandle hTerm)
  409. ;
  410.     IF GENERATINGCFM THEN
  411.         IMPORT_CFM_FUNCTION    TMGetRefCon
  412.     ENDIF
  413.  
  414. ;
  415. ; pascal void TMSetUserData(TermHandle hTerm, long userData)
  416. ;
  417.     IF GENERATINGCFM THEN
  418.         IMPORT_CFM_FUNCTION    TMSetUserData
  419.     ENDIF
  420.  
  421. ;
  422. ; pascal long TMGetUserData(TermHandle hTerm)
  423. ;
  424.     IF GENERATINGCFM THEN
  425.         IMPORT_CFM_FUNCTION    TMGetUserData
  426.     ENDIF
  427.  
  428. ;
  429. ; pascal short TMAddSearch(TermHandle hTerm, ConstStr255Param theString, const Rect *where, TMSearchTypes searchType, TerminalSearchCallBackUPP callBack)
  430. ;
  431.     IF GENERATINGCFM THEN
  432.         IMPORT_CFM_FUNCTION    TMAddSearch
  433.     ENDIF
  434.  
  435. ;
  436. ; pascal void TMRemoveSearch(TermHandle hTerm, short refnum)
  437. ;
  438.     IF GENERATINGCFM THEN
  439.         IMPORT_CFM_FUNCTION    TMRemoveSearch
  440.     ENDIF
  441.  
  442. ;
  443. ; pascal void TMClearSearch(TermHandle hTerm)
  444. ;
  445.     IF GENERATINGCFM THEN
  446.         IMPORT_CFM_FUNCTION    TMClearSearch
  447.     ENDIF
  448.  
  449. ;
  450. ; pascal Point TMGetCursor(TermHandle hTerm, TMCursorTypes cursType)
  451. ;
  452.     IF GENERATINGCFM THEN
  453.         IMPORT_CFM_FUNCTION    TMGetCursor
  454.     ENDIF
  455.  
  456. ;
  457. ; pascal TMErr TMGetTermEnvirons(TermHandle hTerm, TermEnvironRec *theEnvirons)
  458. ;
  459.     IF GENERATINGCFM THEN
  460.         IMPORT_CFM_FUNCTION    TMGetTermEnvirons
  461.     ENDIF
  462.  
  463. ;
  464. ; pascal short TMChoose(TermHandle *hTerm, Point where, TerminalChooseIdleUPP idleProc)
  465. ;
  466.     IF GENERATINGCFM THEN
  467.         IMPORT_CFM_FUNCTION    TMChoose
  468.     ENDIF
  469.  
  470. ;
  471. ; pascal void TMEvent(TermHandle hTerm, const EventRecord *theEvent)
  472. ;
  473.     IF GENERATINGCFM THEN
  474.         IMPORT_CFM_FUNCTION    TMEvent
  475.     ENDIF
  476.  
  477. ;
  478. ; pascal Boolean TMDoTermKey(TermHandle hTerm, ConstStr255Param theKey)
  479. ;
  480.     IF GENERATINGCFM THEN
  481.         IMPORT_CFM_FUNCTION    TMDoTermKey
  482.     ENDIF
  483.  
  484. ;
  485. ; pascal short TMCountTermKeys(TermHandle hTerm)
  486. ;
  487.     IF GENERATINGCFM THEN
  488.         IMPORT_CFM_FUNCTION    TMCountTermKeys
  489.     ENDIF
  490.  
  491. ;
  492. ; pascal void TMGetIndTermKey(TermHandle hTerm, short id, Str255 theKey)
  493. ;
  494.     IF GENERATINGCFM THEN
  495.         IMPORT_CFM_FUNCTION    TMGetIndTermKey
  496.     ENDIF
  497.  
  498. ;
  499. ; pascal void TMGetErrorString(TermHandle hTerm, short id, Str255 errMsg)
  500. ;
  501.     IF GENERATINGCFM THEN
  502.         IMPORT_CFM_FUNCTION    TMGetErrorString
  503.     ENDIF
  504.  
  505.     ENDIF ; __TERMINALS__
  506.